<!DOCTYPE html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>属性绑定</title>
    <style>
        .yy{
            width: 300px;
            height: 160px;
            background-color: #ffdfad;
        }
        .kk{
            width: 200px;
            height: 100px;
            background-color: #81c4ff;
        }
    </style>
</head>
<body>
<div id="yun9">
    <button @click="change">changeColor</button>


   <div :class="class1">我是展示内容的div1</div>

   <div :class="{yy:show1,kk:show2}">我是展示内容的div2</div>


</div>
<script src="../node_modules/vue/dist/vue.js"></script>
<script>
    let app = new Vue({
        el: "#yun9",
        data:{
            class1:"yy",
            class2:"kk",
            show1:false,
            show2:true
        },
        methods:{
            change(){
                this.show1 = !this.show1;
                this.show2 = !this.show2;


                if (this.class1==="kk"){
                    this.class1 = "yy"
                }else{
                    this.class1 = "kk"
                }
            }
        }


    });
</script>
</body>
</html>